<script setup lang="ts">
import { useRoute, useRouter } from 'vue-router'
import { NButton } from 'naive-ui'

const router = useRouter()
const route = useRoute()

</script>

<template>
  <div class="p-[5px]">
    <div>
      <n-button v-if="route.name!=='home'" @click="router.back()">返回</n-button>
    </div>
    <div class="flex w-full h-full">
      <div class="flex-1">
        <router-view v-slot="{ Component }">
          <keep-alive>
            <component :is="Component" />
          </keep-alive>
        </router-view>
      </div>
    </div>
  </div>
</template>

<style scoped></style>
